import { get as getWeb } from '@/api/mnt/serverDeploy'
import Vue from 'vue'

const key = 'server_list'

export function getServerDict(dict) {
  Vue.set(dict.dict, key, {})
  Vue.set(dict.label, key, {})
  Vue.set(dict, key, [])
  getWeb().then(data => {
    dict[key].splice(0, 0, ...data)
    data.forEach(d => {
      Vue.set(dict.dict[key], d.id, d)
      Vue.set(dict.label[key], d.id, d)
    })
  })
}
